<?php
session_start();

// Configuration file
include 'configuration.php';
// Functions
include 'inc/functions.php';

// Include all objects
foreach (glob($configuration['webroot'].'objects/*.php') as $class) { include_once $class; }

if (!CheckSession()):
	// ---------- START: HEAD
	include $configuration['webroot'].'inc/head.php';
	// ---------- END: HEAD
	
	// ---------- START: MENU
	include $configuration['webroot'].'inc/menu.php';
	// ---------- END: MENU
	
	// ---------- START: BODY
	
	$crmuser = new CRMUser();
	include 'forms/login.php';
	
	// ---------- END: BODY
	
	// ---------- START: FOOT
	include $configuration['webroot'].'inc/foot.php';
	// ---------- END: FOOT
	
	// ---------- START: JAVASCRIPTS
	include $configuration['webroot'].'inc/js.php';
	// ---------- END: JAVASCRIPTS
	?>
	
	</body>
	</html>
<?php
else:
	header('Location: dashboard.php');
endif;
?>